package com.shopreg.entity;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name="SHOP_MENU_ITEMS")
public class ShopMenuItems {

	private int itemId;
	private String itemName;
	private String itemDescription;
	private String itemType;
	private ShopMenuCategory shopMenuCategory;
	private PriceDetails price;
	
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ITEM_ID")
	public int getItemId() {
		return itemId;
	}
	public void setItemId(int itemId) {
		this.itemId = itemId;
	}
	@Column(name = "ITEM_NAME")
	public String getItemName() {
		return itemName;
	}
	public void setItemName(String itemName) {
		this.itemName = itemName;
	}
	@Column(name = "ITEM_DESCRIPTION")
	public String getItemDescription() {
		return itemDescription;
	}
	public void setItemDescription(String itemDescription) {
		this.itemDescription = itemDescription;
	}
	@Column(name = "ITEM_TYPE")
	public String getItemType() {
		return itemType;
	}
	public void setItemType(String itemType) {
		this.itemType = itemType;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CATEGORY_ID")
	public ShopMenuCategory getshopMenuCategory() {
		return shopMenuCategory;
	}
	public void setshopMenuCategory(ShopMenuCategory shopMenuCategory) {
		this.shopMenuCategory = shopMenuCategory;
	}
	@OneToOne(fetch=FetchType.EAGER,cascade=CascadeType.ALL,mappedBy="shopMenuItems")
	public PriceDetails getPrice() {
		return price;
	}
	public void setPrice(PriceDetails price) {
		this.price = price;
	}
	
	
}
